Skip to content

gh-111877: Fixes stat() handling for inaccessible files on Windows#113716

Merged
zooba merged 2 commits into
python:mainfrom
zooba:gh-111877
Jan 12, 2024
Merged

gh-111877: Fixes stat() handling for inaccessible files on Windows#113716
zooba merged 2 commits into
python:mainfrom
zooba:gh-111877

Conversation

@zooba

@zooba zooba commented Jan 4, 2024

Copy link
Copy Markdown
Member

@zooba

zooba commented Jan 12, 2024

Copy link
Copy Markdown
Member Author

!buildbot windows

@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @zooba for commit 8b29604 🤖

The command will test the builders whose names match following regular expression: windows

The builders matched are:

  • AMD64 Windows11 Refleaks PR
  • ARM64 Windows Non-Debug PR
  • ARM64 Windows PR
  • AMD64 Windows Server 2022 NoGIL PR
  • AMD64 Windows11 Non-Debug PR
  • AMD64 Windows11 Bigmem PR
  • AMD64 Windows10 PR

@zooba

zooba commented Jan 12, 2024

Copy link
Copy Markdown
Member Author

Buildbots look fine, the one failure is unrelated and doesn't repro across the rest, so I'm choosing to ignore it.

@zooba
zooba merged commit ed06648 into python:main Jan 12, 2024
@miss-islington-app

Copy link
Copy Markdown

Thanks @zooba for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12.
🐍🍒⛏🤖

@zooba
zooba deleted the gh-111877 branch January 12, 2024 15:28
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 12, 2024
…ows (pythonGH-113716)

(cherry picked from commit ed06648)

Co-authored-by: Steve Dower <steve.dower@python.org>
@bedevere-app

bedevere-app Bot commented Jan 12, 2024

Copy link
Copy Markdown

GH-113989 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Jan 12, 2024
zooba added a commit that referenced this pull request Jan 12, 2024
…H-113716)

(cherry picked from commit ed06648)

Co-authored-by: Steve Dower <steve.dower@python.org>
@db3l

db3l commented Jan 15, 2024

Copy link
Copy Markdown
Contributor

Not sure this is the best place to add this, but since this change it appears that my Windows 10 buildbot consistently fails the new test during the main run, but passes upon retry. I'm not sure if it indicates an issue with the test or the environment, but it's never passed at any point the first time, which seems odd - maybe some sort of race that only shows up when the tests are being run in parallel?

The same thing started happening on the 3.12 branch as soon as it was backported.

@zooba

zooba commented Jan 15, 2024

Copy link
Copy Markdown
Member Author

@db3l Can you link one of these failures? Or copy in the error text

@db3l

db3l commented Jan 15, 2024

Copy link
Copy Markdown
Contributor

Sorry, my bad. Here's a recent 3.x run:
https://buildbot.python.org/all/#/builders/146/builds/7436

and the actual failure during the main run (which seems a true failure, as without access still gets a result):

======================================================================
FAIL: test_stat_inaccessible_file (test.test_os.Win32NtTests.test_stat_inaccessible_file)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\buildarea\3.x.bolen-windows10\build\Lib\test\test_os.py", line 3134, in test_stat_inaccessible_file
    self.assertEqual(0, stat2.st_dev)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
AssertionError: 0 != 17153176533692772311
Stdout:
File: @test_6260_tmp�
stat with access: os.stat_result(st_mode=33206, st_ino=844424930132043114, st_dev=17153176533692772311, st_nlink=1, st_uid=0, st_gid=0, st_size=9, st_atime=1705336060, st_mtime=1705336060, st_ctime=1705336060)
 without access: os.stat_result(st_mode=33206, st_ino=844424930132043114, st_dev=17153176533692772311, st_nlink=1, st_uid=0, st_gid=0, st_size=9, st_atime=1705336060, st_mtime=1705336060, st_ctime=1705336060)

The retry at the end of the test run always seems to succeed, but even though the runner says it's retrying in verbose mode I don't get the output from the test, but I expect that could just be an issue in the retry logic.

0:20:55 load avg: 0.22 Re-running 1 failed tests in verbose mode in subprocesses
0:20:55 load avg: 0.22 Run 1 test in parallel using 1 worker process (timeout: 20 min, worker timeout: 25 min)
0:20:56 load avg: 0.22 [1/1] test_os passed
Re-running test_os in verbose mode (matching: test_stat_inaccessible_file)
test_stat_inaccessible_file (test.test_os.Win32NtTests.test_stat_inaccessible_file) ... ok
----------------------------------------------------------------------
Ran 1 test in 0.059s
OK

I've also since noticed that Itamar's windows buildbot seems to be getting the same results, so a test issue seems more likely than buildbot - perhaps something with the icacls (actual execution, or latency) during the regular portion of the run that isn't a subprocess failure? The test itself seems fine to me at first glance otherwise.

@zooba

zooba commented Jan 15, 2024

Copy link
Copy Markdown
Member Author

Yeah, looks like it's failing to reset permissions properly. I wonder if it's because of the Unicode filename, or possibly because it's not using a fully qualified path? I'll try making a full path first, I guess.

I'll ping you on a new PR and we can continue there.

kulikjak pushed a commit to kulikjak/cpython that referenced this pull request Jan 22, 2024
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants